home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-06-26 | 5.9 KB | 109 lines | [TEXT/GEOL] |
- Item 2683063 8-June-89 06:44
-
- From: D0616 Harold Feinleib Assoc, PRT
-
- To: MACAPP.TECH$ MACAPP Tech
-
- cc: X0501 MacApp Developers Assoc, C Nelson
-
- Sub: More TDocument Discussion
-
- Our TDocument problems:
-
- We have had a similar problem with TDocuments, similar to the Accounting
- Package example being discussed.
-
- Our application, has the concept of a ‘Project’ (analogous to the ‘Company
- Set of Books’ in the Acctng pkg) which contain ‘Drawings’ (analogous to
- individual windows (reports, charts, etc.).
- Our User Interface solution is to have a ‘Project Document’, of which only
- one is open at one time, and a number of ‘Drawing Documents’ belonging to that
- project. In the File Menu we have commands; New Project, Open & Close Project,
- a dashed line followed by a Save Command, Print… etc. We then have a Drawings
- Menu which has New Drawing, Close Drawing, and a list of Drawings belonging to
- that project. The “Save” is only highlighted if the top drawing has changes and
- Print, etc. actually apply to Drawings. The user never explicitly saves a
- project—it is saved automatically for him.
- Users do not seem to have any difficulty with this concept.
-
- Our MacApp (1.1.1—sorry) implementation is to have the target chain of
- TOurApplication-TProjectDocument-TDrawingDocument-TWindow-TFrame-TView.
- TOurApplication has its DoSetUpMenus & DoMenuCommand highlight & handle the
- New/Open Project MenuItems.
- TProjectDocument maintains a list of TDrawingDocuments (fDrawingList). Its
- DoSetUpMenus & DoMenuCommand handles Close Project, specific project level
- commands, and all the items in the Drawings menus, except for Close Drawing.
- Closing the the Project does an fDrawingList.Each(CloseDrawing). The Project
- Document has no TWindows or Views and so does not get closed by closing any
- windows.
- TDrawingDocument handles Close Drawing, Save, Print, etc. as well as all
- the specific commands that work on a drawing.
-
- In fact, our situation is much more complicated than that. Above the active
- window may be an additional special non-modal Dialog or Window that pertains to
- a particular TCommand which is active & is attached to the drawing window. And,
- it may have Dialog(s) associated with it. Thus our target chain really reads:
- TOurApplication-TProjectDocument-TDrawingDocument-TDrawingWindow-TDrawingFrame-
- TDrawingView-TNonModalDialogWindow-TNonModalDialogFrame-TNonModalDialogView-TMo
- dalDialogView…………….
- Above all this, we have a floating toolbox window (with its own TWindow &
- TView) that sits above all these other windows and does not even appear in the
- target chain at all.
-
- The problem we have is not so much with the TDocument paradigm, which may
- be easily adapted, but with the target chain implementation. The problem is the
- Target Chain implementation is not a Chain at all. Much of MacApp depends (and
- I don’t know how true this still is in 2.0) on the target chain having the
- specific layout TApplication-TDocument-TWindow-TView.
- For example, when a TDocument closes, instead of just unchaining itself it
- assumes that the target chain should just contain TApplication and so its sets
- gTarget := gApplication. There are numerous other places where this kind of
- behavior takes place.
- The problems associated with overriding the TDocument DoSetUpMenus &
- DoMenuCommands to get nice behavior pale compared to several man-months needed
- to get the target chain to behave ‘nicely’. Target chain bugs still pop up with
- this project in its 2nd year of development. Because of these problems, going
- to 2.0 looms as a future nightmare.
-
- My year old suggestions as well as some new ones are:
-
- 1) The Target chain should ideally be foreward and backward chained. It
- would probably be too difficult to change to this now.
- 2) TEvtHandler objects should, in general, search to the end of the chain
- and INSERT themselves when going on the chain. They should DELETE themselves
- from the chain by searching for themselves rather than say, setting “gTarget :=
- fTarget” which assumes the target is in a certain format.
- 3) TEvtHandler objects might also have a flag(s) pertaining to their
- dealing with the target chain, i.e. an indicator that this object should not go
- on the target chain and/or one that indicates it should never be removed.
- 4) It should be allowable to have multiple TDocuments, Windows, View in the
- target chain at once. Perhaps Activate should be a method of TEvtHandlers. The
- method should call fNextHandler.Activate before/after deactivating/activating
- itself. This requires more thought so when reactivating the path, the proper
- objects need to be activated.
-
- 5) TDocuments should not required an overriding DoMakeViews (&
- DoMakeWindows) method.
-
- 6) I agree with the TFile idea, recently discussed. A TFile object, a
- descendent of TObject, should correspond to a Physical Disk File. TBtreeFile
- could be a descendent of TFile as could TDatabaseFile(?). It would be able to
- open, close, read and write itself. These would be nicer objects than
- TDocument objects for when one needs to access other files in an application
- such as a Settings, or Dictionary file…. (Live Cut & Paste also needs to be
- considered.)
- A TDocument would then have a TFileList which could contain zero or more
- TFile objects—default one. It would be more analogous to the ‘TModel’ idea
- brought up. Its Open, Close, DoRead & DoWrite methods could pass their calls to
- the TFile objects it owns.
- I think this could be added to MacApp in a way transparent to current
- applications.
-
- An additional thought: I think users can understand a strictly hierarchical
- structure fairly easily. More complicated structures become incomprehensible.
- The exception to this may be Settings or Dictionary/Library files or files
- hidden from the users view and don’t require action on his part.
-
- Nick Pisarro, Jr.
-
-